<?php namespace App\Console\Commands;

use HiCommon\Service\AutoScheduleService;
use HiCommon\Service\LogService;
use Illuminate\Console\Command;

class AppointOrderAutoApprise extends Command {

    protected $name = 'ao_auto_apprise';//年检预约单-评价所有7天未评价订单-不给评分只标记订单为已评价状态

    protected $description = '略略略'; // 命令描述，没什么用

    /**
     * 年检预约单-评价所有7天未评价订单-不给评分只标记订单为已评价状态
     *
     * @throws \Exception
     * @author wumengmeng <wu_mengmeng@foxmail.com>
     */
    public function handle()
    {

        try {
            shiwu_start();
            $res = AutoScheduleService::api_auto_apprise_appointment_order();
            shiwu_end($res);
            if($res['state'] != 0){
                LogService::wright_log_for_auto_schedule('7天未评价的年检预约单-error',$res);
            }
        }
        catch (\Exception $exception) {
            $res = ['state'=>1,'msg'=>'失败','data'=>[],'error'=>$exception->getMessage()];
            LogService::wright_log_for_auto_schedule('7天未评价的年检预约单',$res,'error');
        }

    }

}